-
Notifications
You must be signed in to change notification settings - Fork 423
feat: TraceIdRatioBasedSampler and re-sync cross agent tests
#3501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: TraceIdRatioBasedSampler and re-sync cross agent tests
#3501
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3501 +/- ##
==========================================
- Coverage 97.77% 97.64% -0.13%
==========================================
Files 426 427 +1
Lines 55918 56012 +94
Branches 1 1
==========================================
+ Hits 54672 54695 +23
- Misses 1246 1317 +71
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
531c86e to
0356e15
Compare
TraceIdRatioBasedSampler and other sampling fixes
88dfa7a to
f2b2208
Compare
bizob2828
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't fully reviewed but I have some concerns with our approach, especially when you layer on partial granularity/full granularity tracing
| applySamplingDecision(transaction) { | ||
| if (!transaction) return | ||
| // eslint-disable-next-line sonarjs/pseudo-random | ||
| const initPriority = Math.random() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the sample logic as the adaptive, it's just that it calls its shouldSample method. Feels like this should be in the default Sampler class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, that was my first thought too. However the parameters passed into shouldSample differ, so there's no real repeated logic except for the priority calc and truncation.
| } | ||
|
|
||
| // Is it TraceIdRatioBased? | ||
| const ratioBasedSampler = samplerDefinition?.trace_id_ratio_based |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this logic should live in the config. we shouldn't have to check if it's a valid ratio here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that we shouldn't but it's there as kind of a fail safe
0942856 to
c98bd79
Compare
63f0379 to
4bb1061
Compare
04c45d1 to
5ed77ee
Compare
5ed77ee to
5c0285f
Compare
5c0285f to
3dc878c
Compare
TraceIdRatioBasedSampler and other sampling fixesTraceIdRatioBasedSampler and re-sync cross agent tests
ee10b81 to
d41756c
Compare
8e32efe to
e687350
Compare
Description
This PR builds off the new sampling architecture defined by #3527.
This PR adds another
Samplerthat is akin to OpenTelemetry'sTraceIdRatioBasedSampler.How to Test
Cross-agent tests are re-synced! The new tests uncovered some missing pieces with our sampling logic, outside of ratio-based sampling, which this PR solves.
Related Issues
Closes #3387 and closes #3480